const int joystickPinX = A0; const int joystickPinY = A1; void setup() { pinMode(joystickPinX, INPUT); pinMode(joystickPinY, INPUT); } void loop() { int joystickX = analogRead(joystickPinX); int joystickY = analogRead(joystickPinY); if (joystickX > 600) { } else if (joystickX < 400) { } if (joystickY > 600) { } else if (joystickY < 400) { } delay(50); }